﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Modules.zoo.ui {
    import flash.display.*;
    import org.aswing.*;
    import Display.MarketUI.*;
    import Display.aswingui.*;

    public class ZooScrollingList extends MarketScrollingList {

        public static const ZOO_ITEMS:int = 6;
        public static const BUTTON_TOP_BORDER:int = 40;

        protected var m_leftButtonPanel:JPanel;
        protected var m_rightButtonPanel:JPanel;

        public function ZooScrollingList(_arg1:Array, _arg2:Class, _arg3:int, _arg4:int=0, _arg5:int=2){
            super(_arg1, _arg2, _arg3, _arg4, _arg5);
        }
        public function get model():VectorListModel{
            return (this.m_model);
        }
        override protected function get scrollingListItemHeight():Number{
            return (180);
        }
        override protected function get scrollingListItemWidth():Number{
            return (90);
        }
        override public function get numItems():int{
            return (ZOO_ITEMS);
        }
        override protected function get scrollingListGap():int{
            return (-5);
        }
        override protected function prepare():void{
            var _local1:JPanel = ASwingHelper.makeFlowJPanel(FlowLayout.CENTER);
            _local1.appendAll(m_scrollPane);
            ASwingHelper.setSizedBackground(_local1, ZooDialog.assetDict["market_bg"]);
            var _local2:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            var _local3:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            _local2.appendAll(this.m_leftButtonPanel, ASwingHelper.verticalStrut(10));
            _local3.appendAll(this.m_rightButtonPanel, ASwingHelper.verticalStrut(10));
            this.append(_local2);
            this.append(ASwingHelper.horizontalStrut(1));
            this.append(_local1);
            this.append(ASwingHelper.horizontalStrut(-2));
            this.append(_local3);
            this.setChildIndex(_local2, 4);
            ASwingHelper.prepare(this);
        }
        override protected function makeButtons():void{
            var _local2:DisplayObject;
            var _local3:DisplayObject;
            var _local6:DisplayObject;
            var _local1:DisplayObject = (new (ZooDialog.assetDict["left_button_up"])() as DisplayObject);
            _local2 = (new (ZooDialog.assetDict["left_button_over"])() as DisplayObject);
            _local3 = (new (ZooDialog.assetDict["right_button_up"])() as DisplayObject);
            var _local4:DisplayObject = (new (ZooDialog.assetDict["right_button_over"])() as DisplayObject);
            var _local5:DisplayObject = (new (ZooDialog.assetDict["left_button_tab"])() as DisplayObject);
            _local6 = (new (ZooDialog.assetDict["right_button_tab"])() as DisplayObject);
            leftBtn = new JButton();
            leftBtn.wrapSimpleButton(new SimpleButton(_local1, _local2, _local2, _local1));
            leftBtn.setEnabled(false);
            ASwingHelper.setEasyBorder(leftBtn, 15, 2, 0, 0);
            rightBtn = new JButton();
            rightBtn.wrapSimpleButton(new SimpleButton(_local3, _local4, _local4, _local3));
            if (m_data.length <= this.numItems){
                rightBtn.setEnabled(false);
            };
            ASwingHelper.setEasyBorder(rightBtn, 15, 2, 0);
            this.m_leftButtonPanel = ASwingHelper.makeFlowJPanel(FlowLayout.CENTER);
            this.m_leftButtonPanel.append(leftBtn);
            ASwingHelper.setSizedBackground(this.m_leftButtonPanel, _local5);
            this.m_rightButtonPanel = ASwingHelper.makeFlowJPanel(FlowLayout.CENTER);
            this.m_rightButtonPanel.append(rightBtn);
            ASwingHelper.setSizedBackground(this.m_rightButtonPanel, _local6);
            rightBtn.addActionListener(moveRight, 0, true);
            leftBtn.addActionListener(moveLeft, 0, true);
        }

    }
}//package Modules.zoo.ui 
